'use strict';
var even_group_calculate_average = function(collection){

    let result = [];
    let indextwoarr = collection.filter(function(item,index){
        if(index%2!=0)
        return item;
    })  
    let even = indextwoarr.filter((x)=>{
        return x%2==0;
    })
    if(even.length==0){
        result.push(0);
    }
    let arr=[];
    for(let i=0;i<3;i++){
        arr[i]=[];
    }
    for(let item of even){
        if(parseInt(item/10)==0){
            arr[0].push(item);
        }else if(parseInt(item/100)==0){
            arr[1].push(item);
        }else{
            arr[2].push(item);
        }
    }
    for(let item of arr){
        let sum=0;
        for(let iitem of item){
            sum+=iitem;
        }
        if(sum!=0){
            result.push(sum/item.length);
        }
    }
    return result;
    
};
module.exports = even_group_calculate_average;
